package com.mtsmda.designPattern1.creational.factory;

public class ShapeFactory {

	public Shape getShape(String shapeType) {
		if (shapeType == null || shapeType.isEmpty()) {
			return null;
		}

		if (shapeType.equals(Shape.CIRCLE)) {
			return new Circle();
		} else if (shapeType.equals(Shape.RECTANGLE)) {
			return new Rectangle();
		} else if (shapeType.equals(Shape.SQUARE)) {
			return new Square();
		}

		return null;
	}

}